package com.bowen.chapter11;

import java.util.HashMap;

public class UserPrefs extends HashMap {


    public void loadPreference() {
        // 想做解析数据
        this.put("配置KEY_1", "配置值_1");
        this.put("配置KEY_2", "配置值_2");
    }

    public void setBoolForKey(String key, String v) {
        this.put(key, v);
    }

    public Object getBoolForKey(String key, String def) {
        return this.containsKey(key) ? this.get(key) : def;
    }

}
